home *** CD-ROM | disk | FTP | other *** search
- property pBigHandSprite, pLilHandSprite, pSecHandSprite
- global gTime, gLastCall, gMinList
-
- on new me, minutehand, hourhand, secHand
- set pBigHandSprite to minutehand
- puppetSprite(pBigHandSprite, 1)
- set pLilHandSprite to hourhand
- puppetSprite(pLilHandSprite, 1)
- set pSecHandSprite to secHand
- puppetSprite(pSecHandSprite, 1)
- set gLastCall to EMPTY
- set gMinList to [0: "00", 12: "12", 24: "24", 36: "36", 48: "48"]
- sort(gMinList)
- setTime(me)
- return me
- end
-
- on setTime me
- set gTime to the long time
- if gTime = gLastCall then
- exit
- end if
- set gLastCall to gTime
- set tempID to the itemDelimiter
- set the itemDelimiter to ":"
- set hrs to value(item 1 of gTime)
- set mins to item 2 of gTime
- set temp to item 3 of gTime
- set the itemDelimiter to " "
- set secs to value(item 1 of temp)
- set the castNum of sprite pBigHandSprite to the number of member ("BH" & mins)
- set the castNum of sprite pSecHandSprite to the number of member ("SH" & secs)
- setHourHand(me, hrs, value(mins))
- set the itemDelimiter to tempID
- puppetSound("Tick")
- end
-
- on setHourHand me, hrs, mins
- if hrs > 12 then
- set hrs to hrs - 12
- end if
- set whichMin to findPosNear(gMinList, mins - 11)
- set whichHourHand to "LH" & string(hrs) & getAt(gMinList, whichMin)
- set the castNum of sprite pLilHandSprite to the number of member whichHourHand
- end
-